home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19970626-19970929
/
000267_news@newsmaster….columbia.edu _Sat Aug 30 14:24:39 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
3KB
Return-Path: <news@newsmaster.cc.columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id OAA28339
for <kermit.misc@watsun.cc.columbia.edu>; Sat, 30 Aug 1997 14:24:39 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id OAA26825
for kermit.misc@watsun; Sat, 30 Aug 1997 14:24:38 -0400 (EDT)
Path: news.columbia.edu!panix!news.eecs.umich.edu!newsxfer3.itd.umich.edu!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!cs.utexas.edu!news.cs.utah.edu!cc.usu.edu!jrd
From: jrd@cc.usu.edu (Joe Doupnik)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: read \&c[1] does not change the value of the array element
Message-ID: <1K7GSuoXGEbT@cc.usu.edu>
Date: 30 Aug 97 11:11:11 MDT
References: <3405a590.4114629@news.calvacom.fr>
Organization: Utah State University
Lines: 45
Xref: news.columbia.edu comp.protocols.kermit.misc:7584
In article <3405a590.4114629@news.calvacom.fr>, do11@calva.net (Dominique Ottello) writes:
> Hello, it seems there is a problem with read {array element} with MS-DOS
> Kermit 3.15
>
> The command for \%i 1 4 1 {read \&c[\%i]} does not change the content of
> the array element, the command for \%i 1 4 1 {read \%a,assign \&c[\%i] \%a}
> does
>
> Comments please.
>
> Best regards,
>
> for \%i 1 4 1 {assign \&c[\%i] Line \%i}
> for \%i 1 4 1 {Echo {Must be Line : \&c[\%i]}}
> echo
> open write ENTRYPTS.DAT
> for \%i 1 4 1 {write file Line \%i\13\10}
> close write-file
> ;
> for \%i 1 4 1 {assign \&c[\%i] Test \%i}
> for \%i 1 4 1 {Echo {Must be Test : \&c[\%i]}}
> echo
> open read ENTRYPTS.DAT
> for \%i 1 4 1 {read \&c[\%i]}
> close read-file
> for \%i 1 4 1 {Echo {Must be Line : \&c[\%i]}}
> echo
---------------
That's a real bug. It is now fixed, thanks to your report.
For those who have an interest in internal matters, arrays have
a special problem in that an array element's identification has both the
name of the array and possibly a substitution variable as a subscript,
all in one syntatical unit.
In certain situations we wish retain the name portion of the array,
say \&c, but also to replace the possible substitution variable subscript
with its value. We see this above in read \&c[\%i] where we need to retain
\&c[value] literally as the place where results go. In other situations,
such as Echo \&c[\%i], we wish to replace the sub variable \%i with its value
and also replace the array element with its value.
The different approaches are dictated by whether the array element is
a destination (left hand side of a replacement operation, an "l-value") or a
source term (right hand side) in an expression. The READ command failed to
signal l-value-ness for arrays.
Thanks,
Joe D.